# -*- coding:utf-8 -*-
from django.contrib import admin
from models import Problem,Types,Topic,Skills,Checkpoint



class ProblemAdmin(admin.ModelAdmin):
    list_display = ('checkboxname', 'answer',)
    radio_fields = {'answer':True}
    readonly_fields = ('answer',)

class TypesInline(admin.StackedInline):
    model = Topic
    
class TopicInline(admin.StackedInline):
    model = Problem

class TypesAdmin(admin.ModelAdmin):
    inlines = [TypesInline]
    pass

class ConfigAdmin(admin.ModelAdmin):
    pass

class SkillsAdmin(admin.ModelAdmin):
    pass

class CheckpointAdmin(admin.ModelAdmin):
    list_display = ('title','modeltype','status',)
    search_fields = ('title',)
    list_filter = ('modeltype','status')


class TopicAdmin(admin.ModelAdmin):
    inlines = [TopicInline]


class TypesOptions(admin.ModelAdmin):
    
    exclude = ('topic',)


admin.site.register(Problem,ProblemAdmin)
admin.site.register(Types,TypesAdmin)
admin.site.register(Topic,TopicAdmin)
admin.site.register(Skills,SkillsAdmin)
admin.site.register(Checkpoint,CheckpointAdmin)